<form class="form-inline" method="get">

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="user_condition" value="{$user_condition}"
                   placeholder="会员手机|会员姓名|会员ID">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="un_condition" value="{$un_condition}"
                   placeholder="联盟商名称|联盟商ID">
        </div>
    </div>



    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="type-selector" name="type" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                <?php foreach($type_list as $itk=>$item){ ?>
                <option value="{$itk}" {if condition="$type==$itk"}selected{/if}>{$item}</option>
                <?php } ?>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="status-selector" name="status" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                <?php foreach($status_list as $itk=>$item){ ?>
                <option value="{$itk}" {if condition="$status!=''&&$status==$itk"}selected{/if}>{$item}</option>
                <?php } ?>
            </select>
        </div>
    </div>


    <div class="form-group col-xs-3">
        <div class="col-xs-12">
            <span style="">提现时间</span>{include file="public/dateRangePicker" picker-name="time_range" /}
        </div>
    </div>

    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                搜索
            </button>
        </div>
    </div>
</form>

<hr>

<table class="table table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>会员</td>
        <td>联盟商</td>
        <td>提现方式</td>
        <td>提现金额</td>
        <td>手续费用</td>
        <td>应付金额</td>
        <td>状态</td>
        <td>时间</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td>
            <label class="label label-danger">{$item.umobile}【ID：{$item.uid}】</label>
        </td>
        <td>
            {$item.untitle}【ID：{$item.union_id}】
        </td>
        <td style="text-align: left">
            <p>提现方式：{$item.type|get_withdraw_type}</p>
            <p>提现账号：{$item.account}</p>
            <p>账号姓名：{$item.name}</p>
        </td>
        <td>{$item.money}</td>
        <td>{$item.service_charge}</td>
        <td><?php echo $item['money']-$item['service_charge']; ?></td>
        <td>
            {if condition="$item.status==0"}
            <label class="label label-warning">{$item.status|get_withdraw_status}</label>
            {/if}
            {if condition="$item.status==1"}
            <label class="label label-success">{$item.status|get_withdraw_status}</label>
            {/if}
            {if condition="$item.status==2"}
            <label class="label label-danger">{$item.status|get_withdraw_status}</label>
            {/if}
        </td>
        <td>
            <p>提现时间：{$item.create_time|show_datetime}</p>
            {if condition="$item.status > 0"}
            <p>处理时间：{$item.update_time|show_datetime}</p>
            {/if}
        </td>
        <td>
            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    操作
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    {if condition="$item.status==0"}
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="确认打款"
                           data-content="确认已经打款？此条提现记录将改为已打款状态，不可逆转，请慎重操作！"
                           data-url="{:url('confirmpay',array('id'=>$item['id']))}">
                            确认打款
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="提现驳回"
                           data-content="确认驳回此条提现？提现金额将返还会员余额，提现改为已驳回，请慎重操作！"
                           data-url="{:url('reject',array('id'=>$item['id']))}">
                            提现驳回
                        </a>
                    </li>
                    {/if}
                    <li role="separator" class="divider"></li>
                </ul>
            </div>
        </td>

    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$list->render()}
    </div>
</div>

<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {

        //获取分类
        $("#type-selector").select2({
            placeholder: "选择提现方式",
            allowClear: true
        });
        $("#status-selector").select2({
            placeholder: "选择提现状态",
            allowClear: true
        });
    });
</script>